Part Number Hot Search : 
NT6828 TZA3001 MAC12N MPX7050 AF108TC NTE1754 93C56 UT54AC
Product Description
Full Text Search
 

To Download AN2927 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  march 2009 rev 2 1/12 AN2927 application note rc acquisition principle for touch sensing applications introduction in applications requiring user interface, capa citive touch-sensitive controls are becoming the solution of choice to replace conven tional electro-mechanical switches. stmicroelectronics has developed a complete touch-sensing software library to transform any 8-bit stm8 microcontroller into a capacitive touchkey controller. for more details, please go to www.st.com/mcu this touch sensing software library allows to detect human touch by controlling the charge/discharge timing cycle of a rc networ k formed by a single resistor and the touch electrode capacitance. any variation in the rc timing due to the electrode capacity change is detected then filtered and eventually reported to a host system using dedicated i/os or i 2 c/spi interface. the bill of material is low-cost as only one resistor is needed per to uch channel to enable this function. the scope of this application note is to descr ibe the rc time constant acquisition principle used in the touch sensing software library. abbreviations table 1. list of terms acronym description emi electromagnetic interference rc resistor?capacitor ts library st touch sensing firmware library www.st.com
contents AN2927 2/12 contents 1 rc acquisition principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2 hardware implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3 firmware implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.1 charge time measurement principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.1.1 basic measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.1.2 oversampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.2 input voltage measurement principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.3 touched effect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.4 multi-acquisitions and hf noise rejection . . . . . . . . . . . . . . . . . . . . . . . . . . 9 4 revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
AN2927 rc acquisition principle 3/12 1 rc acquisition principle the rc acquisition method is used to detect the human touch of any capacitive touch sensor (key, wheel or slider) by measuring the small variation of the touch electrode capacitance (c). electrode capacitance c is periodically charged and discharged through a fixed resistor (r). the capacitance value depends on the following parameters: electrode area (a), relative dielectric constant of the insulator ( r ), the relative permittivity of air ( 0 ) and the distance between the two electrodes (d). the capaci tance value is summarized with the formula: equation 1 figure 1. voltage applied on an rc network a fixed voltage is applied on v in . the v out voltage increases or decreases proportionally to the capacitance value as shown in figure 2 . figure 2. measuring the charge time the capacitance value (c) is calculated by measuring the charge time (t c ) the v out voltage requires to reach the threshold v th . in touch sensing applications, the capacitance value (c) is the addition of a fixed capacitance (electrode capacitance, c x ) and the capacitance added by the human finger (touch capacitance, c t ) when it touches or is close to the electrode. the electrode capacitance must be kept as low as possible to ensure touch detection which is only a variation of a few picofarads (typically 5pf). using this acquisition principle, it is possibl e to determine if a finger is ?touching? the electrode or not. c r 0 a d --------------- - = v in v out r c v in v out t c v th
rc acquisition principle AN2927 4/12 figure 3. touch acquisition this is the basic principle used in the acquisiti on layer of the touch sensing library to detect a human touch. v in v out t1 no touch v in v out t2 human touch: the overall capacitance increases (t2 > t1)
AN2927 hardware implementation 5/12 2 hardware implementation figure 4 illustrates an implementation example. th e capacitive human touch is detected by measuring the charge/discharge of the rc network composed of r1, r2 and electrode capacitance (c x ) in parallel with the finger capacitance (c t ) (approximately 5pf). there is only one ?load i/o? pin for all the electrodes. resistors r1 and r2 must be placed as close as possible to the mcu. resistor r1 (between hundreds ohms to a few mohms) is the main resistor used to adjust the electr ode sensitivity to touch. resistor r2 (10k ) is optional and is used to reduce noise sensitivity. figure 4. capacitive touch sensing example implementation for more information please read application note an2869 guidelines for designing touch sensing applications . mcu gpio ?load i/o? electrode #1 r2 r1 c x (constant) gpio ?acq i/o? electrode #2 electrode #n gpio gpio c t (variable) finger c x (constant) c x (constant)
firmware implementation AN2927 6/12 3 firmware implementation this section describes the implementation of the rc acquisition principle in the st touch sensing firmware library. 3.1 charge time measurement principle the charge time measurement must be accurate enough to ensure a robust capacitive sensing application. there are two common ways to measure the charge time: 1. the first solution is using an input capt ure (ic) timer which is triggered when the voltage reaches the threshold level. th is approach offers a time measurement resolution which is directly linked to the timer counter frequency. however, as one input capture channel is required per electrode, standard mcus are not compatible with this type of capacitive sensing application. 2. the second solution uses both a simple timer (without ic capa bility) and a simple software sequence which regularly checks if the voltage on the acquisition i/o has reached the threshold level. in this case, the time resolution measurement is equal to the number of cpu cycles used to execute a complete loop of th e software sequence. this measurement approach introduces some jitter which is not compatible with the capacitive sensing acquisition. however, a large number of electrodes can be implemented as there are no hardware constraints. a variant of the second solution obtains a fixed measurement resolution equal to the cpu frequency (f cpu ) by using an adaptive software sequence. this is the approach used in the st touch sensing firmware library and is described below. 3.1.1 basic measurement a general purpose timer performs the charge time measurement. the timer counter start value is saved (or reset) at the beginning of the capacitance charge. when the voltage on the acquisition i/o (acq i/o) reaches a certain threshold level (v th ), the current timer counter value is saved. the difference of the two time counter values gives the charge or discharge time. figure 5. timer counter values counter = start_value counter = stop_value v th
AN2927 firmware implementation 7/12 3.1.2 oversampling the purpose of oversampling is to provide a final measurement of the input voltage high and low levels (v ih and v il ) with the precision of the cpu clock. each successive v ih or v il measurement is delayed by one cpu clock cycle in order to span all the possible values. the number of measurements necessary to span all the values are mcu core dependant. for stm8 microcontrollers, th is number is equal to 8. figure 6 illustrates this concept on an stm8 microcontroller figure 6. input voltage measurements 3.2 input voltage m easurement principle in order to improve the robustness against voltage and temperature variations, two measurements are performed consecutively on the electrodes: the first one measures the capacitance charge until the v ih level is reached. the second measures the capacitance discharge until the v il level is reached. figure 7 and table below illustra te what h appens in detail on the acquisition electrode (acq i/o) and on the load i/o pin. figure 7. capacitance charge/discharge measurements v ih crossing v ih detected here cpu frequency sampling point for eight successive measurements eight successive measurements are delayed to sweep the crossing point area t v il v ih v dd ?acq i/o? pin ?load i/o? pin 1 2 3 4 5 1 gnd
firmware implementation AN2927 8/12 3.3 touched effect the electrode shape and size, the layout from the touch controller device to the electrode (and more specifically the ground coupling) as well as the dielectric panel material and thickness are the main parameters that define the value of the electrode capacitance (c x ). as a consequence, the rc charge and discharg e values are directly dependant on this c x value. figure 8 illustrates this ?t ouched effect?. the time (where the v ih level is reached) is greater than the time . this is the same for the v il level with times t2? and t2. figure 8. ?touched effect? example table 2. capacitance charge/discharge measurement steps step description 1 1. load i/o pin is set in output mode at v dd . 2. acq i/o pin is set in output mode at v dd . 3. timer counter v ih start value is saved (vih_start). 2 acq i/o pin is set in input mode hi-z. --> the electrode capacitance c x is charging. 3 after the voltage on the acq i/o pin reaches v ih : 1. timer counter v ih stop value is saved (vih_stop) and the v ih measurement is calculated and saved (vih_stop ? vih_start). 2. acq i/o pin is set in output mode at v dd . 3. load i/o pin is set in output mode at gnd. 4. timer counter v il start value is saved (vil_start). 4 acq i/o pin is set in input mode hi-z. --> the electrode capacitance c x is discharging. 5 after the voltage on the acq i/o pin reaches v il : 1. timer counter v il stop value is saved (vil_stop) and the v il measurement is calculated and saved (vil_stop ? vil_start). 2. the two measurements ?vih_meas? and ?vil_meas? are added and saved. 3. the process continues with step 1. t v il v ih v dd ?acq i/o? pin ?touched effect? t2? t2 t1? t1
AN2927 firmware implementation 9/12 3.4 multi-acquisitions and hf noise rejection to improve the measurement accuracy and reject high frequency (hf) noise, it is necessary to perform these v ih and v il measurements several times before determining that the key is effectively ?touched?. this number of acquisitions is calculated using one of two variables: the first one is fixed and dependent on the mcu core and the other one is configurable (through the configuration file of the ts library). for information, the number of fixed acquisit ions is set to ?8? for stm8 devices (8 v ih measurements + 8 v il measurements). figure 9. types of acquisitions note: the configurable acquisition number (n) can be set differently in the configuration file of the ts library for the single-channel keys and for the multi-channel keys. the figures below illustrate examples of hf nois e rejection. if the acqu isition number (n) is set to 4, a complete acquisit ion of one electrode will consist of 4 correct ?burst groups? (bgs). the word ?correct? means that all measurements inside the group remain between a minimum and a maximum limit. these example show different scenarios depending on the level of noise. the green line means that the v ih /v il measurement is correct, and the red line indicates an incorrect v ih /v il measurement. figure 10 shows an example where there is no noise and no measurements are rejected. in this example, all the measurements inside each burst group pass. the complete acquisition is done quickly. figure 10. example 1 t ?touched effect? fixed number of v ih /v il measurements configurable acquisition number (n) fixed (?burst group?) start electrode acquisition acquisition ok bg1 pass bg3 pass bg2 pass bg4 pass
firmware implementation AN2927 10/12 figure 11 shows an example where there is a small amount of noise and some measurements are rejected (i.e. r1 and r2). in this example, the burst group 3 (bg3) is repeated until all measurements within this group pass. more time is required for a complete acquisition. figure 11. example 2 figure 12 shows an example where there is a lot of noise and the maximum limit (i.e. 20) is reached. in this case, the complete electrode acquisition is rejected. in this example, the maximum number of rejected measurements is reached and the acquisition is stopped on that electrode. figure 12. example 3 note: the maximum number of rejected measurements is set in the configuration file of the st touch sensing library. calculation of min/max limits these two limits are calculated by applying a multiplication coefficient to the first v ih /v il measurement of each burst group. this multiplication factor is set inside the configuration file of the st touch sensing library. as a consequence the first v ih /v il measurements of each burst group is always ?pass?. in case t he first measurement is ?incorrect?, and the consecutive ones are ?correct?, the burs t group will still be determined ?fail?. acquisition ok bg1 pass bg3 fail bg2 pass bg4 pass bg3 fail bg3 pass remaining measurements are skipped r1 r2 start acquisition stopped bg1 pass bg2 fail bg2 fail bg3 fail (max.) bg2 pass bg3 fail start r1 r2 r3 r21
AN2927 revision history 11/12 4 revision history table 3. document revision history date revision changes 30-jan-2009 1 initial release. 25-mar-2009 2 updated title and figure 6: input voltage measurements .
AN2927 12/12 please read carefully: information in this document is provided solely in connection with st products. stmicroelectronics nv and its subsidiaries (?st ?) reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described he rein at any time, without notice. all st products are sold pursuant to st?s terms and conditions of sale. purchasers are solely responsible for the choice, selection and use of the st products and services described herein, and st as sumes no liability whatsoever relating to the choice, selection or use of the st products and services described herein. no license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. i f any part of this document refers to any third party products or services it shall not be deemed a license grant by st for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoev er of such third party products or services or any intellectual property contained therein. unless otherwise set forth in st?s terms and conditions of sale st disclaims any express or implied warranty with respect to the use and/or sale of st products including without limitation implied warranties of merchantability, fitness for a parti cular purpose (and their equivalents under the laws of any jurisdiction), or infringement of any patent, copyright or other intellectual property right. unless expressly approved in writing by an authorized st representative, st products are not recommended, authorized or warranted for use in milita ry, air craft, space, life saving, or life sustaining applications, nor in products or systems where failure or malfunction may result in personal injury, death, or severe property or environmental damage. st products which are not specified as "automotive grade" may only be used in automotive applications at user?s own risk. resale of st products with provisions different from the statements and/or technical features set forth in this document shall immediately void any warranty granted by st for the st product or service described herein and shall not create or extend in any manner whatsoev er, any liability of st. st and the st logo are trademarks or registered trademarks of st in various countries. information in this document supersedes and replaces all information previously supplied. the st logo is a registered trademark of stmicroelectronics. all other names are the property of their respective owners. ? 2009 stmicroelectronics - all rights reserved stmicroelectronics group of companies australia - belgium - brazil - canada - china - czech republic - finland - france - germany - hong kong - india - israel - ital y - japan - malaysia - malta - morocco - singapore - spain - sweden - switzerland - united kingdom - united states of america www.st.com


▲Up To Search▲   

 
Price & Availability of AN2927

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X